<?php
/**
 * CEOfox
 *
 * @copyright  Copyright 2011-2012 CEOfox, Inc.
 * @license    http://ceofox.com/pages/license
 * @version    $Id: follower.html.php 87089 2013-05-24 09:40:17 $
 * @author     CEOfox, Inc.
 */
?>
<?php
  defined('PHPFOX') or exit('NO DICE!');
?>

{if isset($aFollowers) and count($aFollowers)}
    {if !PHPFOX_IS_AJAX}
        <div id="follower_{$sType}" {if $sFullControllerName == 'follow.index'}style="display: none;"{/if}>
        <div class="table_header">{phrase var='follow.followers'}</div>
    {/if}
        {foreach from=$aFollowers item=aFollower name=follower}        
            <div id="js_follower_{$aFollower.user_id}" class="follower_row_holder js_selector_class_{$aFollower.user_id} {if is_int($phpfox.iteration.follower/2)}row1{else}row2{/if}{if $phpfox.iteration.follower == 1 && !PHPFOX_IS_AJAX} row_first{/if}">
                <div class="friend_image" id="js_image_div_{$aFollower.user_id}">    
                    {img id='sJsUserImage_'$aFollower.user_id'' user=$aFollower suffix='_50_square' max_width=50 max_height=50}
                </div>
                <div class="friend_user_name">
                    {$aFollower|user:'':'':50} 
                </div>
                {if isset($bIsCurrentUser) && $bIsCurrentUser && Phpfox::isUser()}
                    <a class="follow-inline-btn block_{$sType}_{$aFollower.user_id}" href="{url link='follow.block' id=$aFollower.user_id type=$sType oid=$aItem.item_id}"><span class="block follow-button" style="float:right">{phrase var='follow.block'}</span></a>
                    <a style="display:none;" class="follow-inline-btn unblock_{$sType}_{$aFollower.user_id}" href="{url link='follow.unblock' id=$aFollower.user_id type=$sType oid=$aItem.item_id}"><span class="block follow-button" style="float:right">{phrase var='follow.unblock'}</span></a>
                {/if}
                {if $sFullControllerName == 'follow.index'}
                    {if !$aFollower.isFollow && $aFollower.canFollow && Phpfox::isUser()}
                            <a class="follow-inline-btn follow_{$sType}_{$aFollower.user_id}" href="{url link='follow.add' id=$aItem.item_id type=$sType oid=$aFollower.user_id}"><span class="block follow-button" style="float:right">{phrase var='follow.follow'}</span></a>
                            <a style="display:none;" class="follow-inline-btn unfollow_{$sType}_{$aFollower.user_id}" href="{url link='follow.del' id=$aItem.item_id type=$sType oid=$aFollower.user_id}"><span class="block follow-button" style="float:right" onclick="this.submit();">{phrase var='follow.follow'}</span></a>
                    {/if}
                {/if}
            </div>
        {/foreach}
        </div>  
    {if !PHPFOX_IS_AJAX}
        {if $iCurrentFollower < $iTotalFollower}
        <div id="js_pager_view_more_link_{$sBlockType}" class="js_pager_view_more_link" {if $sFullControllerName == 'follow.index'}style="display:none;"{/if}>
            <div class="pager_view_more_holder">
                <div class="feed_view_more">
                    <input id="follow_page_view_follower" type="hidden" name="page" value="2">
                    <input id="current_follower" type="hidden" value="{$iCurrentFollower}">
                    <input id="total_follower" type="hidden" value="{$iTotalFollower}">
                    <input id="follow_page_item_id" type="hidden" name="user_id" value="{$aItem.item_id}">
                    <input id="follow_module_id" type="hidden" name="follow_module_id" value={$sType}>
                    <input id="follow_keyword" type="hidden" name="follow_keyword" value={$sKeyword}>
                    <a class="global_view_mores no_ajax_link" href="#" onclick="$Core.follow.viewMore('follower');return false;">{phrase var='follow.view_more'}</a>
                </div>
            </div>
        </div>
        {/if}
    {/if}
{*else}
    {if $sFullControllerName != 'follow_index'}
        <div class="table_header">{phrase var='follow.followers'}</div>
        <div class="message">
            {phrase var='follow.no_result_s_found'}
        </div>
    {/if*}
{/if}

{if PHPFOX_IS_AJAX}
    <script type="text/javascript">
        $Core.follow.updateCurrent('{$sBlockType}', {$iCurrentFollower});
        $Core.follow.setPage('{$iPage}','{$sBlockType}');
    </script>
{/if}

